﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VersionComparer
{
    public partial class ListManagerForm<T> : Form
        where T: new()
    {
        public ListManagerForm()
        {
            InitializeComponent();
            AcceptButton = btOk;
            CancelButton = btCancel;
            Text = Resources.Resources.ListManagerFormCaption;
        }

        private void btOk_Click(object sender, EventArgs e)
        {
            List = listManagerControl1.List;
            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }

        private void btCancel_Click(object sender, EventArgs e)
        {
            DialogResult = System.Windows.Forms.DialogResult.Cancel;
            Close();
        }
        public ListManagerControl<T> ListManager
        {
            get
            {
                return listManagerControl1;
            }
        }

        public List<T> List
        {
            get;
            set;
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            listManagerControl1.List = List;
        }
    }
}
